package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.Address;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AddressDao {
    @Select("<script>select * from t_address <if test=\"queryString!=null and queryString!=''\">where code=#{queryString} or name=#{queryString}</if></script>")
    public Page<Address> selectByCondition(@Param("queryString") String queryString);
    @Select("select address from t_address")
    List<String> findAddress();
    @Insert("insert into t_address(address,latitude,longitude) values(#{address},#{latitude},#{longitude})")
    void addAddress(Address address);
}
